<template>
  <el-table 
    :data="tableData" height="190" border style="width: 100%"
    :header-cell-style="{background:'#eef1f6',color:'#606266',textAlign:'center'}"
    :cell-style="{textAlign:'center'}" >
    <el-table-column prop="aquaticFish" label="水产品" width="198">
      <template slot-scope="scope">
        <el-button @click="handleClick(scope.row)" type="info" plain size="small" style="width:100%;height:100%">
            {{scope.row.aquaticFish}}
        </el-button>
    </template>
    </el-table-column>
  </el-table>
</template>

<script>
import TMQuaticProduct from "@/api/market-quotation/trading-market-management/tmQuaticProduct.js"; // 交易市场水产品独立接口

  export default {
     props: {
    // 当前市场id
    currentMarketId: {
      type: Number,
      default: 0
    },
  },
    data() {
      return {
        tableData: [
            {id:1,aquaticFish: '鲢鱼',mantissa:'1550'}, 
            {id:2,aquaticFish: '青鱼',mantissa:'3660'}, 
            {id:3,aquaticFish: '鳜鱼',mantissa:'2200'}, 
            {id:4,aquaticFish: '草鱼',mantissa:'2250'}, 
            {id:5,aquaticFish: '鳙鱼',mantissa:'4050'}, 
        ]
      }
    },
    created(){
        this.getAquaticProduct() // 获取水产品
    },
    mounted(){
    },
    methods:{
      // 获取水产品
      async getAquaticProduct(){
        let res=await TMQuaticProduct.queryByMarketId(this.currentMarketId)
        console.log('获取当前市场水产品',res);
        console.log('当前市场id为',this.currentMarketId);
      },
      // 每项水产品
      handleClick(){
        console.log(this.currentMarketId);
      }
    },
    mounted(){
        this.$emit('aquaticStatistics',this.tableData)
    }
  }
</script>

<style scoped>

</style>